from urllib import request


class HtmlDownloader(object):

    def download(self, url):
        if url is None :
            return None
        head={}
        head['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36'
        req = request.Request(url,headers=head)
        response = request.urlopen(req)

        if response.getcode() != 200 :
            return None
        return response.read()